﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MaxLeaf.Platform.Contract;
using MaxLeaf.Platform.BLLImplementation;
using CommonsLib.Utility;
using MaxLeaf.Platform.DataContract;
using CommonsLib.Settings;
using MaxLeaf.Platform.Functions;

namespace MaxLeaf.Platform.BLLProxy
{

    /// <summary>
    /// 入库 相关操作
    /// </summary>
    public class InputProcessorProxy : BaseBLLProxy, IInputProcess
    {

        IInputProcess _bll;
        private  IInputProcess BLL
        {
            get
            {                
                return _bll;
            }
        }
        public InputProcessorProxy():base()
        {
            switch ( Access_Mode )
            {

                case MaxLeaf.Platform.Commons.Const.ACCESS_Direct:
                    {
                        _bll = new InputProcessor();
                        break;
                    }

                case MaxLeaf.Platform.Commons.Const.ACCESS_IIS:
                    {
                        _bll = new InputProcessorWCFClient(this.WCF_Configs);
                        break;
                    }


                default:
                    {
                        throw new MaxLeaf.Platform.Commons.MaxLeafException(MaxLeaf.Platform.Commons.Const.EXCEPTION_MESSAGE_INVALID_ACCESSMODE_CONFIG);

                    }
            }
        }
        
         

        /// <summary>
        /// 如果不需要审核，则直接入库
        /// </summary>
        /// <param name="modelHdr">入库单</param>
        /// <returns>是否入库成功</returns>
        public bool AutoLocAppro(imOthersInputHdrDataModel modelHdr)
        {
            return BLL.AutoLocAppro(modelHdr);
        }
    }
}
